local BaseWnd = require(SCRIPTS_DIR .. ".wnds.BaseWnd");
local CreateTableWnd = class("CreateTableWnd",BaseWnd);
function CreateTableWnd:ctor()
	CreateTableWnd.super.ctor(self);
end

function CreateTableWnd:onOpen()
    self:setButtonEvent()
    local group = self:widget("middle.group")
    group:setScale(0.01)
    mgrs.action:beginAction(group):ScaleTo(0.2,1.1):ScaleTo(0.1,1):endAction()
end

function CreateTableWnd:setEvent()
    -- body
end

function CreateTableWnd:setButtonEvent()
    -- body
    local create = self:widget("middle.group.create")
    self:createClick({targetNode = create}):clickHandler(function()
        mgrs.data:getLoginData():sendCreateTable()
        self:closeAction()
    end);

    local close = self:widget("middle.group.close")
    self:createClick({targetNode = close}):clickHandler(function()
        self:closeAction()
    end);
end

function CreateTableWnd:closeAction()
    -- body
    local group = self:widget("middle.group")
    mgrs.action:beginAction(group):ScaleTo(0.1,1.1):ScaleTo(0.3,0.01):CallFunc(function()
        self:close()
    end):endAction()
end

function CreateTableWnd:onClose()
	
end



------------------------------------------------------------------基础类调用-----------------------------------------------------------------------------
function CreateTableWnd:reqData(handler)
	handler(true);	
end

function CreateTableWnd:getLayer()
	return enums.Layer.Window;
end

function CreateTableWnd:getPreloadResList()
	return {};
end

function CreateTableWnd:getExclusiveType()
	return 0;
end

function CreateTableWnd:isOpenCloseSoundEnabled()
	return false;
end

function CreateTableWnd:onEnter()
	mgrs.log:printDebug("CreateTableWnd:onEnter");
end
function CreateTableWnd:onExit()
	mgrs.log:printDebug("CreateTableWnd:onExit");
end
function CreateTableWnd:onEnterTransitionFinish()
	mgrs.log:printDebug("CreateTableWnd:onEnterTransitionFinish");
end

function CreateTableWnd:onExitTransitionStart()
	mgrs.log:printDebug("CreateTableWnd:onExitTransitionStart");
end


mgrs.wnd:registerWnd(enums.Wnd.CreateTable,CreateTableWnd);

--endregion
